/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package gob.cgr.sgrh.ejb.entidad;

import java.io.Serializable;
import javax.persistence.*;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author MICROSOF
 */
@Entity
@Table(name = "base_concurso")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "BaseConcurso.findAll", query = "SELECT b FROM BaseConcurso b"),
    @NamedQuery(name = "BaseConcurso.findByIdBaseConcurso", query = "SELECT b FROM BaseConcurso b WHERE b.idBaseConcurso = :idBaseConcurso"),
    @NamedQuery(name = "BaseConcurso.findByNumeroBase", query = "SELECT b FROM BaseConcurso b WHERE b.numeroBase = :numeroBase"),
    @NamedQuery(name = "BaseConcurso.findByDescripcion", query = "SELECT b FROM BaseConcurso b WHERE b.descripcion = :descripcion"),
    @NamedQuery(name = "BaseConcurso.findByAprobado", query = "SELECT b FROM BaseConcurso b WHERE b.aprobado = :aprobado")})
public class BaseConcurso implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @NotNull
    @Column(name = "ID_BASE_CONCURSO")
    private Integer idBaseConcurso;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 10)
    @Column(name = "NUMERO_BASE")
    private String numeroBase;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 1000)
    @Column(name = "DESCRIPCION")
    private String descripcion;
    @Size(max = 1)
    @Column(name = "APROBADO")
    private String aprobado;
    @JoinColumn(name = "ID_CONVOCATORIA", referencedColumnName = "ID_CONVOCATORIA")
    @ManyToOne(optional = false)
    private Convocatoria idConvocatoria;

    public BaseConcurso() {
    }

    public BaseConcurso(Integer idBaseConcurso) {
        this.idBaseConcurso = idBaseConcurso;
    }

    public BaseConcurso(Integer idBaseConcurso, String numeroBase, String descripcion) {
        this.idBaseConcurso = idBaseConcurso;
        this.numeroBase = numeroBase;
        this.descripcion = descripcion;
    }

    public Integer getIdBaseConcurso() {
        return idBaseConcurso;
    }

    public void setIdBaseConcurso(Integer idBaseConcurso) {
        this.idBaseConcurso = idBaseConcurso;
    }

    public String getNumeroBase() {
        return numeroBase;
    }

    public void setNumeroBase(String numeroBase) {
        this.numeroBase = numeroBase;
    }

    public String getDescripcion() {
        return descripcion;
    }

    public void setDescripcion(String descripcion) {
        this.descripcion = descripcion;
    }

    public String getAprobado() {
        return aprobado;
    }

    public void setAprobado(String aprobado) {
        this.aprobado = aprobado;
    }

    public Convocatoria getIdConvocatoria() {
        return idConvocatoria;
    }

    public void setIdConvocatoria(Convocatoria idConvocatoria) {
        this.idConvocatoria = idConvocatoria;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idBaseConcurso != null ? idBaseConcurso.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof BaseConcurso)) {
            return false;
        }
        BaseConcurso other = (BaseConcurso) object;
        if ((this.idBaseConcurso == null && other.idBaseConcurso != null) || (this.idBaseConcurso != null && !this.idBaseConcurso.equals(other.idBaseConcurso))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "gob.cgr.sgrh.ejb.entidad.BaseConcurso[ idBaseConcurso=" + idBaseConcurso + " ]";
    }
    
}
